﻿<%@ Page Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="ViewAddExpenseHead.aspx.cs"
    Inherits="Secured_ViewAddExpenseHead" Title="View or Add Expense Heads" Buffer="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder1" runat="Server">
    <div style="font-size: medium">
        View or Add New Expense Heads
    </div>
    <div>
        <asp:Literal ID="ltMsg" runat="server" />
    </div>
    <div>
        <asp:GridView ID="grdExpenseHeads" runat="server" DataKeyNames="HeadID" AutoGenerateColumns="False"
            AutoGenerateEditButton="True" BackColor="White" BorderColor="#CC9966" BorderStyle="None"
            BorderWidth="1px" CellPadding="4" 
            onrowcancelingedit="grdExpenseHeads_RowCancelingEdit" 
            onrowediting="grdExpenseHeads_RowEditing">
            <RowStyle BackColor="White" ForeColor="#330099" />
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <EmptyDataTemplate>
                No Expense Heads to Fetch. Add a new Head
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="HeadID" Visible="false" />
                <asp:TemplateField HeaderText="Expense Head">
                    <ItemTemplate>
                        <%# Eval("ExpenseHead") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtExpenseHead" runat="server" Text='<%# Eval("ExpenseHead") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div>
        <p>
            Add New Head:<br />
            <asp:TextBox ID="txtAddHead" runat="server" Width="300px" /><br />
            <asp:Button ID="btnAddHead" runat="server" Text="Add Head" 
                onclick="btnAddHead_Click" />
        </p>
    </div>
</asp:Content>
